//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package study.API.集合.set;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class Set_demo {
    public Set_demo() {
    }

    public static void main(String[] args) {
        Set<String> set = new HashSet();
        System.out.println(set.add("张三"));
        System.out.println(set.add("张三"));
        System.out.println(set);
        set.add("李四");
        set.add("王五");
        System.out.println(set);
        Iterator<String> iterator = set.iterator();

        while(iterator.hasNext()) {
            System.out.println((String)iterator.next());
        }

        for(String str : set) {
            System.out.println(str);
        }

        set.forEach((strx) -> System.out.println(strx));
    }
}
